import request from '@/utils/request'

// 获取房产列表
export const getProperty = (params) => {
  return request.get('/properties', { params })
}

// 获取房产的数量
export const getPropertyCount = (params) => {
  return request.get('/properties/count', { params })
}

// 添加房产信息
export const addPropertyInfo = (data) => {
  return request.post('/properties', data)
}

// 删除房产信息
export const removeProperty = (id) => {
  return request.delete(`/properties/${id}`)
}

// 根据id获取指定房产信息
export const getPropertyInfo = (id) => {
  return request.get(`/properties/${id}`)
}

// 更新房产数据
export const editPropertyInfo = (data) => {
  return request.put(`/properties/${data.id}`, data)
}
